import { defineStore } from "pinia";
export const useSubStore = defineStore("subStore", {
  state: () => {
    return {
      baseInfo: null,
      key: "1",
    };
  },
  actions: {
    setTableData(data) {
      console.log("setTableData", data);
      this.baseInfo = {
        form: {
          tableData: data,
        },
      };
    },
  },
  getters: {
    tableData: (state) =>
      state.baseInfo?.form?.tableData.filter(
        (item) => item.key !== state.key
      ) ?? [],
  },
  persist: {},
});
